import request from "../request";
import {
    ApplyZZYParams,
    DoVerifyParams,
    EnrollDetailParams,
    EnrollFormParams,
    EnrollFormZZParams,
    FetchEnrollFormParams, VerifyEnrollDetailParams,
    VerifyEnrollParams, ZZYEnrollDetailParams, ZZYEnrollListParams, 
    DoVerifyYZZZNOParams
} from "../../types/requestTypes";
import {
    ApplyZZYRes,
    DoVerifyEnrollRes,
    FetchEnrollListRes, FetchUserEnrollListRes,
    FetchVerifyEnrollDetailRes,
    FetchVerifyEnrollRes, FetchZZYEnrollDetailRes, FetchZZYEnrollListRes,
    ResponseRET
} from "../../types/responseTypes";

/**
 * 更新报名表
 * @param params
 */
export const updateEnrollForm = (params: EnrollFormParams): Promise<ResponseRET> => {
    return request.post('/restapi/STUA_mbreport_new/ET_ENROLLS',params,true)
}

/**
 * 更新报名表多种证件
 * @param params
 */
export const updateEnrollZZForm = (params: EnrollFormZZParams): Promise<ResponseRET> => {
    return request.post('/restapi/STUA_mbreport_new/ET_ENROLLS_ZZ',params,true)
}

/**
 * 获取报名表
 * @param params
 */
export const getEnrollFormList = (params: FetchEnrollFormParams): Promise<FetchEnrollListRes> => request.post('/restapi/STUA_mbreport_new/RDENROLLS_LIST', params, true)

/**
 * 获取指定报名表
 * @param params
 */
export const getEnrollDetail = (params: EnrollDetailParams): Promise<FetchEnrollListRes> => request.post('/restapi/STUA_mbreport_new/RDENROLLS_ID', params, true)

/**
 * 获取带审核状态的报名表
 * @param params
 */
export const getVerifyEnrollList = (params: VerifyEnrollParams): Promise<FetchVerifyEnrollRes> => request.post('/restapi/STUA_mbreport_new/RDCLASS_BM_LIST',params, true)

/**
 * 审核报名表
 * @param params
 */
export const doVerifyEnroll = (params: DoVerifyParams): Promise<DoVerifyEnrollRes> => request.post('/restapi/STUA_mbreport_new/SH_CLASS_BM', params, true)

/**
 * 获取带审核状态的报名表详情
 * @param params
 */
export const getVerifyEnrollDetail = (params: VerifyEnrollDetailParams): Promise<FetchVerifyEnrollDetailRes> => request.post('/restapi/STUA_mbreport_new/RDCLASS_BM_ID',params, true)

/**
 * 获取用户报名表
 * @param userId
 */
export const getUserEnrollList = (userId: string): Promise<FetchUserEnrollListRes> => request.post('/restapi/STUA_mbreport_zl/RDENROLLS_CUSERID', {
    OPERATOR_ID: userId
}, true)

/**
 * 提交转班申请
 * @param params
 */
export const doApplyZZY = (params: ApplyZZYParams): Promise<ApplyZZYRes> => request.post('/restapi/STUA_mbreport_new/ET_CLASS_BM_ZZSQ',params,true)

/**
 * 查询需转班审核的报名表列表
 * @param params
 */
export const getZZYEnrollList = (params: ZZYEnrollListParams): Promise<FetchZZYEnrollListRes> => request.post('/restapi/STUA_mbreport_new/RDCLASS_BM_ZZSQ_LIST',params, true)

/**
 * 查询指定需转班审核的报名表
 * @param params
 */
export const getZZYEnrollDetail = (params: ZZYEnrollDetailParams): Promise<FetchZZYEnrollDetailRes> => request.post('/restapi/STUA_mbreport_new/RDCLASS_BM_ZZSQ_ID',params,true)

/**
 * 审核转班报名表
 * @param params
 */
export const doVerifyZZYEnroll = (params: DoVerifyParams): Promise<ResponseRET> => request.post('/restapi/STUA_mbreport_new/SH_CLASS_BM_ZZSQ',params,true)

/**
 * 
 * @param params 验证身份证号是否正确
 * @returns 
 */
export const doVerifyYZZZNO = (params: DoVerifyYZZZNOParams): Promise<ResponseRET> => request.post('/restapi/STUA_mbreport_new/YZ_ZZNO', params, true)
